package com.kimho.localtion.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kimho.localtion.domain.Localtion;
import com.kimho.localtion.persistence.LocaltionMapper;

@Service
public class LocaltionService {
	@Autowired
	private LocaltionMapper localtionMapper;
	
	public List<Localtion> localtionList(){
		return this.localtionMapper.localtionList();
	}
	@Transactional
	public void insertLocaltion(Localtion localtion,Map<String,Object> param) {
		//新增物流
		localtionMapper.insertLocaltion(localtion);
	}
	@Transactional
	public void deleteLocaltion(Map<String,Object> param) {
		String ids = (String)param.get("ids");
		String[] idsArray = ids.split(",");
		for(int i=0;i<idsArray.length;i++) {
			param.put("id", idsArray[i]);
			localtionMapper.deleteLocaltion(param);
		}
	}
}
